from dataclasses import dataclass
from datetime import datetime

from exts import db
@dataclass
class Attachment(db.Model):
    __tablename__ = 'attachment'
    id:int = db.Column(db.Integer, primary_key=True,autoincrement=True, comment='主键id')
    name:str  =db.Column(db.String(255),comment='文件名称')
    path:str  =db.Column(db.String(255),comment='文件路径')
    code:str  =db.Column(db.String(255),comment='文件code')
    mime:str  =db.Column(db.String(255),comment='文件mime类型')
    extension:str  =db.Column(db.String(255),comment='文件类型')
    size:str  =db.Column(db.String(255),comment='文件大小')
    md5:str  =db.Column(db.String(255),comment='文件md5')
    sha1:str  =db.Column(db.String(255),comment='文件sha1')
    driver:str  =db.Column(db.String(255),comment='上传驱动')
    status:str  =db.Column(db.String(255),comment='上传状态')
    url:str  =db.Column(db.String(255),comment='文件地址')
    update_time:datetime  =db.Column(db.DateTime, default=datetime.now,comment='更新时间')
    create_time:datetime  =db.Column(db.DateTime, default=datetime.now,onupdate=datetime.now,comment='创建时间')